package com.surfacing.rcp.client.editors;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CBanner;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.layout.TableColumnLayout;

public class TransportzielView extends ViewPart {
	
	public static final String ID = "com.surfacing.rcp.ui.views.TransportzielView";
	private Text inputSearchTpo;
	private Text inputCreateTpo;
	private Table table;
	public TransportzielView() {
	}

	@Override
	public void createPartControl(Composite parent) {
		parent.setLayout(new GridLayout(1, false));
		
		TabFolder tabFolder = new TabFolder(parent, SWT.NONE);
		GridData gd_tabFolder = new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 1);
		gd_tabFolder.heightHint = 76;
		tabFolder.setLayoutData(gd_tabFolder);
		
		TabItem tabSearchItem = new TabItem(tabFolder, SWT.NONE);
		tabSearchItem.setText("Suche");
		
		Group group = new Group(tabFolder, SWT.NONE);
		tabSearchItem.setControl(group);
		group.setLayout(new GridLayout(11, false));
		
		Label lblNachname = new Label(group, SWT.NONE);
		lblNachname.setSize(58, 15);
		lblNachname.setText("Suche");
		
		inputSearchTpo = new Text(group, SWT.BORDER);
		GridData gd_inputSearchTpo = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_inputSearchTpo.widthHint = 200;
		inputSearchTpo.setLayoutData(gd_inputSearchTpo);
		inputSearchTpo.setSize(76, 21);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		
		Button btnSearchTpo = new Button(group, SWT.NONE);
		GridData gd_btnSearchTpo = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_btnSearchTpo.widthHint = 100;
		btnSearchTpo.setLayoutData(gd_btnSearchTpo);
		btnSearchTpo.setSize(44, 25);
		btnSearchTpo.setText("Suche");
		
		TabItem tabNewTpo = new TabItem(tabFolder, SWT.NONE);
		tabNewTpo.setText("Neues Transportziel");
		
		Group group_1 = new Group(tabFolder, SWT.NONE);
		tabNewTpo.setControl(group_1);
		group_1.setLayout(new GridLayout(11, false));
		
		Label lblTransportziel = new Label(group_1, SWT.NONE);
		lblTransportziel.setText("Transportziel");
		lblTransportziel.setBounds(0, 0, 48, 15);
		
		inputCreateTpo = new Text(group_1, SWT.BORDER);
		GridData gd_inputCreateTpo = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_inputCreateTpo.widthHint = 200;
		inputCreateTpo.setLayoutData(gd_inputCreateTpo);
		inputCreateTpo.setBounds(0, 0, 212, 21);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		
		Button btnCreateTpo = new Button(group_1, SWT.NONE);
		GridData gd_btnCreateTpo = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_btnCreateTpo.widthHint = 100;
		btnCreateTpo.setLayoutData(gd_btnCreateTpo);
		btnCreateTpo.setText("Erstellen");
		btnCreateTpo.setBounds(0, 0, 44, 25);
		
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setLayout(new GridLayout(1, false));
		
		Composite resultTable = new Composite(composite, SWT.NONE);
		resultTable.setBounds(0, 0, 64, 64);
		resultTable.setLayout(new TableColumnLayout());
		
		TableViewer tableViewer = new TableViewer(resultTable, SWT.BORDER | SWT.FULL_SELECTION);
		table = tableViewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		// TODO Auto-generated method stub

	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}
}
